package org.nhindirect.stagent;

import java.util.Collection;

import javax.mail.internet.ContentType;

public class MimeEntityCollection extends MultipartEntity
{
    ObjectCollection<MimeEntity> m_entities;
    
    public MimeEntityCollection()
    {
    	super();
    }
    
    public MimeEntityCollection(ContentType contentType)
    {
    	super(contentType);
    }
    
    public MimeEntityCollection(String contentType)
    {
    	super(contentType);
    }                
    
    public MimeEntityCollection(String contentType, Collection<MimeEntity> parts)
    {
    	super(contentType);
        this.getEntities().add(parts);        
    }
    
    public boolean hasEntities()
    {
        return (this.m_entities != null && this.m_entities.size() > 0);
    }
            
    public ObjectCollection<MimeEntity> getEntities()
    {
        if (this.m_entities == null)
        {
            this.m_entities = new ObjectCollection<MimeEntity>();
        }
        
        return this.m_entities;
    }	
}
